//
//  ViewController.m
//  EpubReader
//
//  Created by Adiljan on 2017/2/16.
//  Copyright © 2017年 Adiljan. All rights reserved.
//

#import "ViewController.h"
#import "ADViewController.h"
#import "ReaderViewController.h"

@interface ViewController ()

@end

@implementation ViewController

#pragma mark - Lifecycle
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initVariable];
    [self initNavigationBar];
    [self initView];
    [self initNotification];
    
}

#pragma mark - Custom Accessors
/**
 *  初始化一些变量
 */
-(void)initVariable{
    
    UIAlmasLabel *lab = [[UIAlmasLabel alloc]init];
    lab.frame = CGRectMake(0, 5, 50, 30);
    lab.text = NSLocalizedString(@"home", nil);
    self.navigationItem.titleView = lab;
}
/**
 *  初始化导航栏
 */
-(void)initNavigationBar{
    
    
}
/**
 *  初始化一些view
 */
-(void)initView{
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *btnC = [[UIButton alloc]initWithFrame:self.view.bounds];
    [self.view addSubview:btnC];
    [btnC addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
}

/**
 *  注册一些广播
 */
-(void)initNotification{
    
}
- (void)btnClick:(UIButton *)sender{
//    ADViewController *ad = [[ADViewController alloc]initWithNibName:@"ADViewController" bundle:nil];
//    [self.navigationController pushViewController:ad animated:YES];
    
    //切换到阅读页面
    ReaderViewController *epubViewController=[[ReaderViewController alloc]init];
//    epubViewController.view.backgroundColor = [UIColor redColor];
//    epubViewController.wantsFullScreenLayout=YES;
//    [[UIApplication sharedApplication] setStatusBarHidden:YES];
//    epubViewController.strUpubPath = path;
    [self presentModalViewController:epubViewController animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
